from random import randint

test_list = [randint(1, 100) for i in range(10)]
print(test_list)
# print([i for i in range(0,10)])

def select_sort(test: list):
    """
    选择排序使用一个内循环“选择”当前循环区间内最大(小)的数，放在循环区间的最后(前)，
    :param test:
    :return:
    """
    for i in range(len(test), 0, -1):
        max_index = 0
        for j in range(0,i):
            if test[j] > test[max_index]:
                max_index = j
        test[max_index],test[j]=test[j],test[max_index]

    return test


print(select_sort(test_list))
